#pragma once

#include <common/BlockingQueue.h>
#include <common/EventBase.h>
#include <common/Network.h>
#include <common/Pipeline.h>
#include <common/Rule.h>
#include <folly/MPMCPipeline.h>

namespace flashpp {

class Expander : public EventBase {
 public:
  Expander(Pipeline& pipeline, Network& network);

  void process(DataPlaneUpdate& dpu, AtomicOverwrite& ao);

 private:
  void seq(DataPlaneUpdate& dpu, AtomicOverwrite& ao);
  void par(DataPlaneUpdate& dpu, AtomicOverwrite& ao);
  Network& network_;
  std::mutex mutex_;
};

} // namespace flashpp